package com.heima.clients.schedule;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.schedule.dto.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author xiaquanen
 * @version 1.0
 * @project heima-leadnews
 * @date 2024/7/26 09:39:08
 */
@FeignClient("leadnews-schedule")
public interface ITaskClient {


    /**
     * 添加消息
     *
     * @param taskDto
     * @return
     */
    @PostMapping("/api/v1/schedule/addTask")
    public ResponseResult addTask(@RequestBody TaskDto taskDto);


    /**
     * 拉取消息
     *
     * @param taskType
     * @param priority
     * @return
     */
    @GetMapping("/api/v1/schedule/pullTask/{taskType}/{priority}")
    public ResponseResult pullTask(@PathVariable("taskType") Integer taskType,@PathVariable("priority") Integer priority);

}
